﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Secure/Secure.Master" AutoEventWireup="true" CodeBehind="View User.aspx.cs" Inherits="Site.Secure.View_User" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" runat="server">
    <h1>View Users</h1>
<a>This Page Allows you to view the users that are currently registered to use this website.</a>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <h2>Registered Users</h2>
    <asp:ListView ID="ListView1" runat="server" DataSourceID="SqlDataSource1">
        <AlternatingItemTemplate>
            <tr style="">
                <td>
                    <asp:Label ID="userIDLabel" runat="server" Text='<%# Eval("userID") %>' />
                </td>
                <td>
                    <asp:Label ID="userTypeLabel" runat="server" Text='<%# Eval("userType") %>' />
                </td>
            </tr>
        </AlternatingItemTemplate>
        <EditItemTemplate>
            <tr style="">
                <td>
                    <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                        Text="Update" />
                    <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                        Text="Cancel" />
                </td>
                <td>
                    <asp:TextBox ID="userIDTextBox" runat="server" Text='<%# Bind("userID") %>' />
                </td>
                <td>
                    <asp:TextBox ID="userTypeTextBox" runat="server" 
                        Text='<%# Bind("userType") %>' />
                </td>
            </tr>
        </EditItemTemplate>
        <EmptyDataTemplate>
            <table runat="server" style="">
                <tr>
                    <td>
                        No data was returned.</td>
                </tr>
            </table>
        </EmptyDataTemplate>
        <InsertItemTemplate>
            <tr style="">
                <td>
                    <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                        Text="Insert" />
                    <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                        Text="Clear" />
                </td>
                <td>
                    <asp:TextBox ID="userIDTextBox" runat="server" Text='<%# Bind("userID") %>' />
                </td>
                <td>
                    <asp:TextBox ID="userTypeTextBox" runat="server" 
                        Text='<%# Bind("userType") %>' />
                </td>
            </tr>
        </InsertItemTemplate>
        <ItemTemplate>
            <tr style="">
                <td>
                    <asp:Label ID="userIDLabel" runat="server" Text='<%# Eval("userID") %>' />
                </td>
                <td>
                    <asp:Label ID="userTypeLabel" runat="server" Text='<%# Eval("userType") %>' />
                </td>
            </tr>
        </ItemTemplate>
        <LayoutTemplate>
            <table runat="server">
                <tr runat="server">
                    <td runat="server">
                        <table ID="itemPlaceholderContainer" runat="server" border="0" style="">
                            <tr  runat="server" style="">
                                <th runat="server">
                                    Username</th>
                                <th runat="server">
                                    User Type</th>
                            </tr>
                            <tr ID="itemPlaceholder" runat="server">
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr runat="server">
                    <td runat="server" style="">
                    </td>
                </tr>
            </table>
        </LayoutTemplate>
        <SelectedItemTemplate>
            <tr style="">
                <td>
                    <asp:Label ID="userIDLabel" runat="server" Text='<%# Eval("userID") %>' />
                </td>
                <td>
                    <asp:Label ID="userTypeLabel" runat="server" Text='<%# Eval("userType") %>' />
                </td>
            </tr>
        </SelectedItemTemplate>
    </asp:ListView>
     <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
        ConnectionString="<%$ ConnectionStrings:csMain %>" 
        SelectCommand="SELECT userID, userType FROM [Users] WHERE userHidden='False'" 
        ProviderName="System.Data.SqlClient"></asp:SqlDataSource>
</asp:Content>
